<?php

/**
 * Mark filter form base class.
 *
 * @package    LIAnnot
 * @subpackage filter
 * @author     Cedric Richier
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseMarkFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_annoset' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Annoset'), 'add_empty' => true)),
      'paula_id'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'list_type'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'base'       => new sfWidgetFormFilterInput(),
      'att_id'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'href'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'type'       => new sfWidgetFormFilterInput(),
      'x_position' => new sfWidgetFormFilterInput(),
      'y_position' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'id_annoset' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Annoset'), 'column' => 'id')),
      'paula_id'   => new sfValidatorPass(array('required' => false)),
      'list_type'  => new sfValidatorPass(array('required' => false)),
      'base'       => new sfValidatorPass(array('required' => false)),
      'att_id'     => new sfValidatorPass(array('required' => false)),
      'href'       => new sfValidatorPass(array('required' => false)),
      'type'       => new sfValidatorPass(array('required' => false)),
      'x_position' => new sfValidatorPass(array('required' => false)),
      'y_position' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('mark_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Mark';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'id_annoset' => 'ForeignKey',
      'paula_id'   => 'Text',
      'list_type'  => 'Text',
      'base'       => 'Text',
      'att_id'     => 'Text',
      'href'       => 'Text',
      'type'       => 'Text',
      'x_position' => 'Text',
      'y_position' => 'Text',
    );
  }
}
